package cn.edu.ctbu.lab.dao;

import cn.edu.ctbu.lab.domain.Student;
import cn.edu.ctbu.lab.domain.Teacher;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;

import java.util.List;

public interface TeacherRepository extends JpaRepository<Teacher,Integer> {

    List<Teacher> findByNoAndPassword(String no, String password);

    @Query(value = "select * from tb_teacher where name like %:name% LIMIT 0,50",nativeQuery = true)
    List<Teacher> findByNameAndPage(String name);
}
